// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) 

package com.nnee.stat.a;

import com.nnee.p_fk.p_a.cls_b;
import com.nnee.p_fk.p_a.cls_m;
import com.nnee.p_fk.p_b.cls_c;
import com.nnee.p_fk.p_b.cls_d;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.text.SimpleDateFormat;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Locale;
import java.util.zip.GZIPOutputStream;
import org.apache.http.entity.ByteArrayEntity;
import org.json.JSONException;
import org.json.JSONObject;

// Referenced classes of package com.nnee.stat.a:
//            b

public class cls_a extends  com.nnee.p_fk.b.a
    implements cls_d
{

    private cls_a(int i1, String s, JSONObject jsonobject, LinkedList linkedlist, boolean flag, boolean flag1)
    {
        super(i1);
        k = s;
        f = jsonobject;
        g = linkedlist;
        i = flag;
        j = flag1;
    }

    private cls_a(String s, boolean flag)
    {
        super(0x10002);
        k = s;
        j = flag;
    }

    protected static cls_a a(String s, JSONObject jsonobject, LinkedList linkedlist, boolean flag, boolean flag1)
    {
        return new cls_a(0x10003, s, jsonobject, linkedlist, flag, flag1);
    }

    public static cls_a a(String s, JSONObject jsonobject, boolean flag)
    {
        return new cls_a(0x10001, s, jsonobject, null, false, flag);
    }

    protected static cls_a a(String s, boolean flag)
    {
        return new cls_a(s, flag);
    }

    private static String a(String s, byte abyte0[])
    {
        String s1 = null;
        if(s != null && abyte0 != null) goto _L2; else goto _L1
_L1:
        return s1;
_L2:
        File file;
        Object aobj[] = new Object[1];
        aobj[0] = s;
        file = new File(String.format("/data/data/%s/stfiles/", aobj));
        String s2;
        if(!file.exists())
            file.mkdirs();
        File file1 = new File(file, (new StringBuilder()).append(a().format(Calendar.getInstance().getTime())).append(".st").toString());
        file1.createNewFile();
        FileOutputStream fileoutputstream = new FileOutputStream(file1);
        fileoutputstream.write(abyte0);
        fileoutputstream.close();
        s2 = file1.getPath();
        s1 = s2;
        continue; /* Loop/switch isn't completed */
        Exception exception;
        exception;
        exception.printStackTrace();
        if(true) goto _L1; else goto _L3
_L3:
    }

    private static SimpleDateFormat a()
    {
        if(a == null)
            a = new SimpleDateFormat("yyyyMMddHHmmssSSS", Locale.ENGLISH);
        return a;
    }

    private static void a(String s)
    {
        File file = new File(s);
        if(file.exists())
            file.delete();
_L2:
        return;
        Exception exception;
        exception;
        if(true) goto _L2; else goto _L1
_L1:
    }

    public static void a(String s, JSONObject jsonobject, LinkedList linkedlist)
    {
        if(o != null || linkedlist.size() > 0)
        {
            a(jsonobject, ((List) (linkedlist)));
            a(s, b());
        }
    }

    private static void a(JSONObject jsonobject, List list)
    {
        if(jsonobject != null) goto _L2; else goto _L1
_L1:
        return;
_L2:
        String s = b(jsonobject, list);
        if(s == null) goto _L1; else goto _L3
_L3:
        byte abyte0[] = s.getBytes();
        Object aobj[] = n;
        aobj;
        JVM INSTR monitorenter ;
        if(o != null && p != null) goto _L5; else goto _L4
_L4:
        o = new ByteArrayOutputStream();
        p = new GZIPOutputStream(o);
_L6:
        p.write(abyte0);
_L7:
        aobj;
        JVM INSTR monitorexit ;
          goto _L1
        Exception exception;
        exception;
        throw exception;
_L5:
        p.write(m);
       